<template>
  <div>
    <ul>
        <li v-for='(item,index) in list' :key='index'> {{item}} <button @click='remove(index)'>X</button></li>
    </ul>
    <!-- <router-view></router-view> -->
  </div>
    
</template>
<script>
// @ is an alias to /src
export default {
    name: 'LIST',
    data() {
        return {
        
        }
    },
    created() {
      console.log(this)
    },
    computed: {
      list(){
        return this.$store.state.todoList
      }
    },
    methods: {
      remove(n){
        this.$store.commit('remove',n)
      }
    },
}
</script>
<style lang="less">

</style>